package com.edu.lxshpc.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.edu.lxshpc.pojo.Phrase;
import com.edu.lxshpc.service.PhraseService;
import com.edu.lxshpc.mapper.PhraseMapper;
import com.edu.lxshpc.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Sanshan
 * @description 针对表【phrase】的数据库操作Service实现
 * @createDate 2023-11-13 20:54:32
 */
@Service
public class PhraseServiceImpl extends ServiceImpl<PhraseMapper, Phrase>
        implements PhraseService {
    @Autowired
    private PhraseMapper phraseMapper;

    @Override
    public Result getPhrase() {
        int i = RandomUtil.randomInt(1, 100);
        Phrase phrase = phraseMapper.selectById(i);
        return Result.success(phrase);
    }
}




